Socket
Socket
Sign inDemoInstall

ts-md5

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-md5

TypeScript MD5 implementation


Version published
Weekly downloads
412K
increased by10.66%
Maintainers
2
Weekly downloads
 
Created

What is ts-md5?

The ts-md5 npm package is a TypeScript implementation of the MD5 hashing algorithm. It allows you to generate MD5 hashes for strings, arrays, and other data types. This package is useful for creating checksums, verifying data integrity, and other cryptographic purposes.

What are ts-md5's main functionalities?

Hashing a String

This feature allows you to generate an MD5 hash from a string. The `hashStr` method takes a string as input and returns its MD5 hash.

const { Md5 } = require('ts-md5');
const hash = Md5.hashStr('Hello World');
console.log(hash); // Outputs the MD5 hash of 'Hello World'

Hashing an Array

This feature allows you to generate an MD5 hash from an array of ASCII values. The `hashAsciiStr` method takes an array of ASCII values as input and returns its MD5 hash.

const { Md5 } = require('ts-md5');
const hash = Md5.hashAsciiStr([72, 101, 108, 108, 111]);
console.log(hash); // Outputs the MD5 hash of the ASCII values for 'Hello'

Incremental Hashing

This feature allows you to perform incremental hashing. You can append strings or arrays in parts and then call the `end` method to get the final MD5 hash.

const { Md5 } = require('ts-md5');
const md5 = new Md5();
md5.appendStr('Hello');
md5.appendStr(' World');
const hash = md5.end();
console.log(hash); // Outputs the MD5 hash of 'Hello World'

Other packages similar to ts-md5

Keywords

FAQs

Package last updated on 16 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc